package cn.edu.ujn.project.supermarket.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.project.common.core.text.Convert;
import cn.edu.ujn.project.supermarket.domain.GoodsInfor;
import cn.edu.ujn.project.supermarket.mapper.GoodsInforMapper;
import cn.edu.ujn.project.supermarket.service.IGoodsInforService;

/**
 * 商品信息Service业务层处理
 * 
 * @author zhaomh
 * @date 2023-11-14
 */
@Service
public class GoodsInforServiceImpl implements IGoodsInforService 
{
    @Autowired
    private GoodsInforMapper goodsInforMapper;

    /**
     * 查询商品信息
     * 
     * @param barCode 商品信息主键
     * @return 商品信息
     */
    @Override
    public GoodsInfor selectGoodsInforByBarCode(String barCode)
    {
        return goodsInforMapper.selectGoodsInforByBarCode(barCode);
    }

    /**
     * 查询商品信息列表
     * 
     * @param goodsInfor 商品信息
     * @return 商品信息
     */
    @Override
    public List<GoodsInfor> selectGoodsInforList(GoodsInfor goodsInfor)
    {
        return goodsInforMapper.selectGoodsInforList(goodsInfor);
    }

    /**
     * 新增商品信息
     * 
     * @param goodsInfor 商品信息
     * @return 结果
     */
    @Override
    public int insertGoodsInfor(GoodsInfor goodsInfor)
    {
        return goodsInforMapper.insertGoodsInfor(goodsInfor);
    }

    /**
     * 修改商品信息
     * 
     * @param goodsInfor 商品信息
     * @return 结果
     */
    @Override
    public int updateGoodsInfor(GoodsInfor goodsInfor)
    {
        return goodsInforMapper.updateGoodsInfor(goodsInfor);
    }

    /**
     * 批量删除商品信息
     * 
     * @param barCodes 需要删除的商品信息主键
     * @return 结果
     */
    @Override
    public int deleteGoodsInforByBarCodes(String barCodes)
    {
        return goodsInforMapper.deleteGoodsInforByBarCodes(Convert.toStrArray(barCodes));
    }

    /**
     * 删除商品信息信息
     * 
     * @param barCode 商品信息主键
     * @return 结果
     */
    @Override
    public int deleteGoodsInforByBarCode(String barCode)
    {
        return goodsInforMapper.deleteGoodsInforByBarCode(barCode);
    }
}
